package com.lx.util.secure.algorithm;

import com.lx.util.LX;
import com.lx.util.secure.algorithm.encrypt.Aes;
import com.lx.util.secure.algorithm.encrypt.Des;
import com.lx.util.secure.algorithm.encrypt.Rsa;

public enum SecureType {
     RSA(Rsa.class)
    ,DES(Des.class)
    ,AES(Aes.class)
    ;

    private Class<? extends SecureAlgorithm> clazz;
    SecureType(Class<? extends SecureAlgorithm> clazz){
        this.clazz = clazz;
    }

    public SecureAlgorithm getSecureAlgorithm(byte[] key){
        return LX.Reflection.newInstance(clazz).key(key);
    }
    public SecureAlgorithm getSecureAlgorithm(String keyStr){
        return LX.Reflection.newInstance(clazz).key(keyStr);
    }

}
